package com.athbsd.exer5;

import com.athbsd.exer4.Student;
import org.junit.Test;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/**
 * Date:2025/2/24
 * Author：zhouzhou
 * Description:
 */
public class SetTest {
    @Test
    public void test1() {
        Set set=new HashSet();
        set.add(1);
        set.add("AA");
        set.add("BB");
        set.add(2);
        set.add(new Student("tom",12));
        set.add(new Student("tom", 12));
        set.add("tom");
        Iterator iterator = set.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }


    }
}
